//
//  GSCommonLoginToastView.m
//  GSCalendar
//
//  Created by guoshikeji_a on 2018/9/6.
//  Copyright © 2018年 tanyin. All rights reserved.
//

#import "GSCommonLoginToastView.h"

#import "GSCommonLoginMMMaterialDesignSpinner.h"

@interface GSCommonLoginToastView ()

@property (nonatomic, strong) GSCommonLoginMMMaterialDesignSpinner *designSpinner;

@end

@implementation GSCommonLoginToastView

- (NSArray *)tintColors {
    return @[
             RGBHEX(0x4286F5),
             RGBHEX(0xDA493C),
             RGBHEX(0xFFD04A),
             RGBHEX(0x119E57),
             RGBHEX(0xFFD04A)
             ];
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.backgroundColor = RGBHEXA(0xFFFFFF, 0.15);
        [self setupSubviews];
    }
    return self;
}

- (void)setupSubviews {
    self.designSpinner = [GSCommonLoginMMMaterialDesignSpinner new];
    self.designSpinner.hidesWhenStopped = true;
    self.designSpinner.tintColors = [self tintColors];
    [self addSubview:self.designSpinner];
    [self.designSpinner mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.width.height.mas_equalTo(30.0);
        make.centerY.mas_equalTo(self);
    }];
}

- (void)startAnimation {
    [self.designSpinner startAnimating];
}
- (void)stopAnimation {
    [self.designSpinner stopAnimating];
}

@end
